unit USingleton;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

type
  TForm2 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  TSingleton = class
  strict private
    class var FInstance: TSingleton;
    constructor Create;
  public
    class function GetInstance: TSingleton;
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

constructor TSingleton.Create;
begin
  inherited;
end;

class function TSingleton.GetInstance: TSingleton;
begin
  If FInstance = nil Then
  begin
    FInstance := TSingleton.Create();
  end;
  Result := FInstance;
end;

end.
